package com.youyi.yyfilepickerlibrary.core.util;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AlertDialog;

public class DialogUtil {
    public static void showPermissionDialog(final Activity activity, String str) {
        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
        builder.setMessage("您未授权 " + str + " 权限, 请在权限管理中开启此权限。").setTitle("提示").setPositiveButton("确认", new DialogInterface.OnClickListener() {
            /* class com.youyi.yyfilepickerlibrary.core.util.DialogUtil.AnonymousClass2 */

            public void onClick(DialogInterface dialogInterface, int i) {
                activity.startActivity(new Intent("android.settings.SETTINGS"));
            }
        }).setNegativeButton("取消", new DialogInterface.OnClickListener() {
            /* class com.youyi.yyfilepickerlibrary.core.util.DialogUtil.AnonymousClass1 */

            public void onClick(DialogInterface dialogInterface, int i) {
                dialogInterface.dismiss();
            }
        });
        builder.create().show();
    }
}
